"""
数据集的划分是重要步骤，代码需要熟练，经常会用到
"""
from sklearn.datasets import load_iris
from sklearn.model_selection import train_test_split

# 加载数据集
x, y = load_iris(return_X_y=True)
# 划分数据集
x_train, x_test, y_train, y_test = train_test_split(x, y, test_size=0.2, random_state=22)

print(x_train.shape)
print(x_test.shape)